<?php /* Smarty version 2.6.26, created on 2018-07-20 02:32:06
         compiled from E:%5CWWW%5C40.125.208.171%5Cvweb/admin%5Ctemplates/goods/index.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'img_size', 'E:\\WWW\\40.125.208.171\\vweb/admin\\templates/goods/index.html', 43, false),array('modifier', 'cat', 'E:\\WWW\\40.125.208.171\\vweb/admin\\templates/goods/index.html', 59, false),array('modifier', 'escape', 'E:\\WWW\\40.125.208.171\\vweb/admin\\templates/goods/index.html', 59, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index/header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?> 
<div class="nav"><span>商品列表</span></div>
<div class="filter"> 
	<input type="button" name="del_checked" class="del_ck button" value="删除选项"/> 
	<a href="?m=goods" class="<?php if ($_GET['status'] == ''): ?>option_ch<?php else: ?>option<?php endif; ?>">全部</a>
	<a href="?m=goods&status=1" class="<?php if ($_GET['status'] == '1'): ?>option_ch<?php else: ?>option<?php endif; ?>">已通过</a>
	<a href="?m=goods&status=2" class="<?php if ($_GET['status'] == '2'): ?>option_ch<?php else: ?>option<?php endif; ?>">已失效</a>
	<a href="?m=goods&status=0" class="<?php if ($_GET['status'] == '0'): ?>option_ch<?php else: ?>option<?php endif; ?>">待审核</a> 
	<form action="#" method="get">
		<input type="hidden" name="m" value="goods"/>	
		<input type="hidden" name="a" value="index"/>
		<div class="sch">
			<input type="text" name="key" class="text" value="" placeholder="请输入产品关键字"/>
			<input type="submit" class="submit" value="确定"/>
		</div>
	</form> 
</div>
<div class="main"> 
	<table width="100%" class="ltable">
	  	<thead>
		  	<tr>
				<th width="30"><input type="checkbox" class="checked_all"/></th>
				<th width="80">分类</th>
				<th width="40">图片</th>
				<th>标题</td> 
				<th width="120">店铺</th>
				<th width="40" class="center">主页</th>
				<th width="40" class="center">热卖</th>
				<th width="40" class="center">推荐</th>
				<th width="50">销量</th>
				<th width="50">库存</th>
				<th width="50">状态</th> 
				<th width="140">操作</th>
				<th width="80">时间</th>
		  	</tr>
	  	</thead>
		<tbody>
		<?php if ($this->_tpl_vars['data']['list']): ?>
			<?php $_from = $this->_tpl_vars['data']['list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['i']):
?>
				<tr>
					<td><input name="key_id[]" type="checkbox" value="<?php echo $this->_tpl_vars['i']['id']; ?>
" class="checked_list"/></td>
					<td><?php echo $this->_tpl_vars['i']['cats_cn']; ?>
</td>
					<td><a href="index.php?m=goods&a=detail&id=<?php echo $this->_tpl_vars['i']['id']; ?>
" target="_blank"><img src="<?php echo $this->_tpl_vars['__IMG__']; ?>
<?php echo ((is_array($_tmp=$this->_tpl_vars['i']['images'])) ? $this->_run_mod_handler('img_size', true, $_tmp, '50x50') : $this->_plugins['modifier']['img_size'][0][0]->img_size($_tmp, '50x50')); ?>
" width="35" height="35"/></a></td> 
					<td valign="top"><a href="index.php?m=goods&a=detail&id=<?php echo $this->_tpl_vars['i']['id']; ?>
" target="_blank"><?php echo $this->_tpl_vars['i']['title']; ?>
</a></td> 
					<td><?php echo $this->_tpl_vars['i']['shop_name']; ?>
</td>
					<td class="center"><a href="javascript:status('<?php echo $this->_tpl_vars['i']['id']; ?>
','px_index')" id="px_index_<?php echo $this->_tpl_vars['i']['id']; ?>
"><img src="<?php echo $this->_tpl_vars['__APP__']; ?>
public/images/status_<?php echo $this->_tpl_vars['i']['px_index']; ?>
.png"></a></td>
					<td class="center"><a href="javascript:status('<?php echo $this->_tpl_vars['i']['id']; ?>
','px_hot')" id="px_hot_<?php echo $this->_tpl_vars['i']['id']; ?>
"><img src="<?php echo $this->_tpl_vars['__APP__']; ?>
public/images/status_<?php echo $this->_tpl_vars['i']['px_hot']; ?>
.png"></a></td>
					<td class="center"><a href="javascript:status('<?php echo $this->_tpl_vars['i']['id']; ?>
','px_recommend')" id="px_recommend_<?php echo $this->_tpl_vars['i']['id']; ?>
"><img src="<?php echo $this->_tpl_vars['__APP__']; ?>
public/images/status_<?php echo $this->_tpl_vars['i']['px_recommend']; ?>
.png"></a></td>
					<td><?php echo $this->_tpl_vars['i']['volume']; ?>
</td>
					<td><?php echo $this->_tpl_vars['i']['stock']; ?>
</td>
					<td>
						<?php if ($this->_tpl_vars['i']['status'] == '1'): ?>
							<a href="?m=goods&a=status&id=<?php echo $this->_tpl_vars['i']['id']; ?>
">下线</a>
						<?php else: ?>
							<a href="?m=goods&a=status&id=<?php echo $this->_tpl_vars['i']['id']; ?>
"><span style="color:#FF0000; font-weight:bold;">上线</span></a>
						<?php endif; ?> 
					</td> 
					<td>
						<a href="?m=shop&a=enter_shop&id=<?php echo $this->_tpl_vars['i']['shop_id']; ?>
&url=<?php echo ((is_array($_tmp=((is_array($_tmp='member.php?m=goods&a=edit&id=')) ? $this->_run_mod_handler('cat', true, $_tmp, $this->_tpl_vars['i']['id']) : smarty_modifier_cat($_tmp, $this->_tpl_vars['i']['id'])))) ? $this->_run_mod_handler('escape', true, $_tmp, 'url') : smarty_modifier_escape($_tmp, 'url')); ?>
" class="edit" target="_blank">进店编辑</a>
						<a href="javascript:;" data-id="<?php echo $this->_tpl_vars['i']['id']; ?>
" class="del">删除</a>
					</td>
					<td><?php echo $this->_tpl_vars['i']['addtime']; ?>
</td>
				</tr>
			<?php endforeach; endif; unset($_from); ?>
		<?php else: ?>
	  			<tr><td colspan="13">还没有数据，赶快添加吧！</td></tr>
		<?php endif; ?>
		</tbody>
	</table>
	<div class="operate">
		<?php if ($this->_tpl_vars['data']['page']): ?><div class="tpage"><?php echo $this->_tpl_vars['data']['page']; ?>
</div><?php endif; ?>
	</div>
</div>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index/footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?> 
<script type="text/javascript">
_delete("?m=goods&a=del", '.del_ck');
function status(id,type){
	$.post("?m=goods&a=px_status",{id:id, type:type},function(data){
 		if(data == '0' || data == '1'){
			$("#"+type+"_"+id+" img").attr('src','<?php echo $this->_tpl_vars['__APP__']; ?>
public/images/status_'+data+'.png');
		}else{ alert('更新失败'); } 
	});	
} 
</script>